<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
    <link href="${path}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
</head>
<body class="page-header-fixed">
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
<div class="page-sidebar-wrapper">
    <jsp:include page="../common/menu.jsp"/>
</div>
<div class="page-content-wrapper">
<div class="page-content">
<div class="row">
<div class="col-md-12">
<form class="form-horizontal form-row-seperated">
<div class="portlet box purple">
<div class="portlet-title">
    <div class="caption">
        <i class="fa fa-shopping-cart"></i>会员信息
    </div>
    <div class="actions btn-set">
        <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left"></i> 返回</a>
        <button type="button" id="btnSave" class="btn blue"><i class="fa fa-check"></i> 保存</button>
    </div>
</div>
<div class="portlet-body">
    <div class="tabbable">
        <div class="tab-content no-space">
            <div class="tab-pane active" id="tab_general">
                <div class="form-body">
                    <div class="form-group">
                        <label class="col-md-2 control-label">用户名:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-3">
                            <input type="text" name="userName" class="form-control" datatype="*"
                                   ignore="ignore" value="${data.userName}"
                                   <c:if test="${data.userName!=null}">readonly="readonly"</c:if>/>
                        </div>
                        <label class="col-md-2 control-label">手机号:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-3">
                            <input type="text" name="mobile" class="form-control" value="${data.mobile}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">用户状态:</label>
                        <div class="col-md-3">
                            <select name="status" class="form-control">
                                <option value="0">活动</option>
                                <option value="1" <c:if test="${data.status=='1'}">selected="selected"</c:if>>冻结
                                </option>
                            </select>
                        </div>
                        <label class="col-md-2 control-label">认证状态:</label>
                        <div class="col-md-3">
                            <select name="approve" class="form-control">
                                <option value="0" <c:if test="${data.approve=='0'}">selected="selected"</c:if>>未认证</option>
                                <option value="1" <c:if test="${data.approve=='1'}">selected="selected"</c:if>>已认证</option>
                                <option value="2" <c:if test="${data.approve=='2'}">selected="selected"</c:if>>审核不通过</option>
                                <option value="3" <c:if test="${data.approve=='3'}">selected="selected"</c:if>>已提交</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="form-group">
				    <label class="col-md-2 control-label">用户级别:</label>
				    <div class="col-md-3">
				        <select name="userLevel" class="form-control">
				            <option value="0"    <c:if test="${data.userLevel=='0'}">selected="selected"</c:if>>运营商</option>
				            <option value="1"   <c:if test="${data.userLevel=='1'}">selected="selected"</c:if>>超级会员</option>
				                  <option value="2" <c:if test="${data.userLevel=='2'}">selected="selected"</c:if>>普通会员</option>
				                   				 <option value="3"    <c:if test="${data.userLevel=='3'}">selected="selected"</c:if>>初级代理</option>
				      				            <option value="4"    <c:if test="${data.userLevel=='4'}">selected="selected"</c:if>>高级代理</option>
				      				            <option value="5"    <c:if test="${data.userLevel=='5'}">selected="selected"</c:if>>1星运营商</option>
				      				            <option value="6"    <c:if test="${data.userLevel=='6'}">selected="selected"</c:if>>2星运营商</option>
				      				            <option value="7"    <c:if test="${data.userLevel=='7'}">selected="selected"</c:if>>3星运营商</option>
				      				                   <option value="8"    <c:if test="${data.userLevel=='8'}">selected="selected"</c:if>>4星运营商</option>
				      				            <option value="9"    <c:if test="${data.userLevel=='9'}">selected="selected"</c:if>>5星运营商</option>
				      
				        </select>
				    </div>
				 
				  <label class="col-md-2 control-label">我的邀请码:</label>
                        <div class="col-md-3">
                            <input type="text" name="myyqm" class="form-control" datatype="n|/^-?\d+\.\d+$/"
                                   ignore="ignore" value="${data.myyqm}"/>
                        </div>
                        
                  
                       
				</div>  
				
				<div class="form-group">
				        <label class="col-md-2 control-label">粉丝数:</label>
                        <div class="col-md-3">
                            <input type="text" name="fans" class="form-control" datatype="n|/^-?\d+\.\d+$/"
                                   ignore="ignore" value="${data.fans}"/>
                        </div>
                        
                              <label class="col-md-2 control-label">邀请链接:</label>
                        <div class="col-md-3">
                            <input type="text"  class="form-control" 
                                  value="http://kylj.kylj365.com/w/register/toregister?yqm=${data.myyqm}"/>
                        </div>
			</div> 
			
					<div class="form-group">
				        <label class="col-md-2 control-label">总佣金:</label>
                        <div class="col-md-3">
                            <input type="text" name="ktxmoney"   class="form-control"   
                                   value="${data.ktxmoney==null?0:data.ktxmoney}"/>
                        </div>
                        
			</div>
 
                    <div class="form-group">
                        <label class="col-md-2 control-label">积分:</label>
                        <div class="col-md-3">
                            <input type="text" name="score" class="form-control" 
                                   ignore="ignore" value="${data.score==null?0:data.score}"/>
                        </div>
                        <label class="col-md-2 control-label">佣金:</label>
                        <div class="col-md-3">
                            <input type="text" name="money" class="form-control"  
                                   ignore="ignore" value="${data.money==null?0:data.money}"/>
                        </div>
                    </div>
                    <!-- 个人信息 -->
                    <%--<div class="form-group">
                        <label class="col-md-2 control-label">性别:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-3">
                            <select name="sex" class="form-control">
                                <option value="0">女</option>
                                <option value="1" <c:if test="${data.sex==1}">selected="selected"</c:if>>男</option>
                            </select>
                        </div>
                        <label class="col-md-2 control-label">生日:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-3">
                            <input type="text" name="birthday" class="form-control" value="${data.birthday}"
                                   datatype="*" readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                        </div>
                    </div>--%>
                    <div class="form-group">
                        <label class="col-md-2 control-label">真实姓名:</label>
                        <div class="col-md-3">
                            <input type="text" name="realname" class="form-control" <%--datatype="*2-10"--%>
                                   value="${data.realname}"/>
                        </div>
                        <label class="col-md-2 control-label">身份证号:</label>
                        <div class="col-md-3">
                            <input type="text" name="cardNum" class="form-control"
                                   <%--datatype="/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/|/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|X|x)$/"--%>
                                   value="${data.cardNum}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">QQ:</label>

                        <div class="col-md-3">
                            <input type="text" name="email" class="form-control" <%--datatype="n5-13"--%>
                                   value="${data.email}"/>
                        </div>
                        <label class="col-md-2 control-label">固定电话:
                        </label>

                        <div class="col-md-1">
                            <input type="text" name="areaCode" class="form-control" datatype="n0-4"
                                   value="${data.areaCode}"/>
                        </div>
                        <div class="col-md-2">
                            <input type="text" name="telPhone" class="form-control" datatype="n0-8"
                                   value="${data.telPhone}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">所属省:</label>
                        <div class="col-md-2">
                                               <input type="text" name="province" class="form-control" 
                                   value="${data.province}"/>
                        </div>
                        <div class="col-md-3">
                                               <input type="text" name="city" class="form-control" 
                                   value="${data.city}"/>
                        </div>
                        <div class="col-md-3">
                                               <input type="text" name="district" class="form-control" 
                                   value="${data.district}"/>
                        </div>
                    </div>
                    
                      <div class="form-group">
                        <label class="col-md-2 control-label">开户行:</label>

                        <div class="col-md-3">
                      <input type="text"  class="form-control" value="${memberCard.smh}  "/>
                        </div>
                           <label class="col-md-2 control-label">持卡人姓名:
                        </label>

                        <div class="col-md-3">
                            <input type="text"  class="form-control" value="${memberCard.cardname}"/>
                        </div>
                        
                   
                    </div>
                      <div class="form-group">
                           <label class="col-md-2 control-label">卡号:
                        </label>

                        <div class="col-md-3">
                            <input type="text" class="form-control" value="${memberCard.cardnumber}"/>
                        </div>
                      </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">单位名称:</label>

                        <div class="col-md-3">
                            <input type="text" name="companyName" class="form-control" value="${data.companyName}"/>
                        </div>
                        <label class="col-md-2 control-label">职务:
                        </label>

                        <div class="col-md-3">
                            <input type="text" name="job" class="form-control" value="${data.job}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">个人住址:
                        </label>
                        <div class="col-md-3">
                            <input type="text" name="personalLocation" class="form-control"
                                   value="${data.personalLocation}"/>
                        </div>
                        <label class="col-md-2 control-label">单位住址:
                        </label>

                        <div class="col-md-3">
                            <input type="text" name="companyLocation" class="form-control"
                                   value="${data.companyLocation}"/>
                        </div>
                    </div>
                    <div class="form-group" id="pic">
                        <label class="col-md-2 control-label">证件照:</label>

                        <div class="col-md-8">
                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                <div class="fileinput-new thumbnail"
                                     style="width: 300px; height: 150px;">
                                    <img src="${data.cardImgUrl}">
                                </div>
                                <div class="fileinput-preview fileinput-exists thumbnail"
                                     style="max-width: 300px; max-height: 150px;">
                                </div>
                                <div>
                                <span class="btn default btn-file">
                                    <span class="fileinput-new">选择图片</span>
                                    <span class="fileinput-exists">修改图片</span>
                                    <input type="file" id="file" name="file"/>
                                </span>
                                    <a href="#" class="btn default fileinput-exists" data-dismiss="fileinput">移除图片</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%--<div class="modal fade bs-modal-sm" id="panelPic" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-body">
                    <img src="${data.cardImgUrl}"/>
                </div>
            </div>
        </div>
    </div>--%>
</div>
<div class="portlet-title">
    <div class="actions btn-set">
        <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left"></i> 返回</a>
        <button type="button" id="btnSave1" class="btn blue"><i class="fa fa-check"></i> 保存</button>
    </div>
</div>
</div>
<input type="hidden" name="id" value="${data.id}">
<input type="hidden" name="openId" value="${data.openId}">
<input type="hidden" name="nickName" value="${data.nickName}">
<input type="hidden" name="headImg" value="${data.headImg}">



<input type="hidden" name="isdls" value="${data.isdls}">
<input type="hidden" name="tuandui" value="${data.tuandui}">
<input type="hidden" name="tdlist" value="${data.tdlist}">


<input type="hidden" name="sjyqm" value="${data.sjyqm}">
<input type="hidden" name="fid" value="${data.fid}">




<input type="hidden" name="userType" value="0">
<input type="hidden" id="cardImgUrl" name="cardImgUrl" value="${data.cardImgUrl}"/>
</form>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/biz/jsAddress.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery.input-ip-address-control-1.0.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery.pwstrength.bootstrap/src/pwstrength.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/biz/ajaxfileupload.js"></script>

<script type="text/javascript">
    var form;
    $(function () {
        form = $("form").Validform({
            tiptype: 3,
            postonce: true,
            showAllError: true,
            callback: function (data) {
                if (data && data.statusCode === 200) {
                    //if(confirm("保存成功，是否跳转到会员管理页面？"))
                    window.location.href = _path + "/member/list?userType=0";
                } else {
                    App.bubble(500, "保存失败！");
                }
            }
        });
        $("#btnSave").click(function (e) {
            ajaxFileUpload(save);
        });
        $("#btnSave1").click(function (e) {
            ajaxFileUpload(save);
        });
        addressInit('province', 'city', 'district', '北京市', '北京', '海淀区');
        <c:if test="${data.userType==0}">
        $("#province").val('${data.province}').change();
        $("#city").val('${data.city}').change();
        $("#district").val('${data.district}').change();
        </c:if>
    });

    function save() {
        form.ajaxPost(false, true, _path + "/member/save");
    }
    function ajaxFileUpload(callback) {
        if (!$("#file").val()) {
//            if (!$("#cardImgUrl").val()) {
//                alert("请上传证件照！");
//            } else {
                callback();
//            }
            return;
        }
        $("#loading").ajaxStart(function () {
            $(this).show();
        }).ajaxComplete(function () {
            $(this).hide();
        });
        $.ajaxFileUpload({
            url: '${path}/conf/upload',
            secureuri: false,
            fileElementId: 'file',
            dataType: 'json',
            success: function (data, status) {
                switch (data.statusCode) {
                    case 200 :
                        $("#cardImgUrl").val(data.uri);
                        callback();
                        break;
                    case 500 :
                        alert(data.info);
                        break;
                }
            }
        });
        return false;
    }

</script>
</body>
<!-- END BODY -->
</html>